﻿CREATE TABLE [dbo].[DefinedRelationshipFunctions] (
    [SRNameWithDir]       NVARCHAR (100) NOT NULL,
    [ShortFunctionName]   NVARCHAR (50)  NOT NULL,
    [DisplayFunctionName] NVARCHAR (100) NULL,
    [FunctionCommand]     NVARCHAR (255) NULL,
    [SelfFunction]        BIT            CONSTRAINT [DF_DefinedRelationshipFunctions_SelfFunction] DEFAULT ((0)) NULL,
    [ViewName]            NVARCHAR (50)  NULL,
    [E1LinkName]          NVARCHAR (100) NULL,
    [E2LinkName]          NVARCHAR (100) NULL,
    [EditAttributes]      NVARCHAR (MAX) NULL,
    [DisplayAttributes]   NVARCHAR (MAX) NULL,
    [GroupableAttributes] NVARCHAR (MAX) NULL,
    [SortableAttributes]  NVARCHAR (MAX) NULL,
    [TabOrder]            INT            NULL,
    [TemplateGroupName]   NVARCHAR (100) NULL,
    CONSTRAINT [PK_DefinedRelationshipFunctions] PRIMARY KEY CLUSTERED ([SRNameWithDir] ASC, [ShortFunctionName] ASC)
);








GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_DefinedRelationshipFunctions]
    ON [dbo].[DefinedRelationshipFunctions]([ShortFunctionName] ASC);

